import { request } from '@/sheep/request';

const route = {
  path: 'groupgoods',
  name: 'seller.admin.groupgoods',
  component: () => import('./index.vue'),
  meta: {
    title: '商品服务',
  },
};

const api = {
  list: (params) =>
    request({
      url: '/group/admin/goods',
      method: 'GET',
      params,
    }),
  status: (data) =>
    request({
      url: '/group/admin/goods/statusEdit',
      method: 'POST',
      data,
    }),
  categoryList: () =>
    request({
      url: '/group/admin/goods/category_list',
      method: 'GET',
    }),
  hair_list: () =>
    request({
      url: '/group/admin/goods/hair_list',
      method: 'GET',
    }),
  add: (data) =>
    request({
      url: '/group/admin/goods',
      method: 'POST',
      data,
    }),
  details: (id) =>
    request({
      url: `/group/admin/goods/${id}`,
      method: 'GET',
    }),
  edit: (id, data) =>
    request({
      url: `/group/admin/goods/${id}`,
      method: 'PUT',
      data,
    }),
  inStock: (data) =>
    request({
      url: '/group/admin/goods/inStock',
      method: 'POST',
      data,
    }),
  outStock: (data) =>
    request({
      url: '/group/admin/goods/outStock',
      method: 'POST',
      data,
    }),
  delete: (id) =>
    request({
      url: `/group/admin/goods/${id}`,
      method: 'DELETE',
    }),
};

export { route, api };